import ApiUtils from './api/ApiUtils';

const api = {
    // 登录
    'getOpenedId': [
        '/login_by_code',
        {
            "action": "获取openId",
            "method": "post",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded',
            }
        }
    ],
    'getRegister': [
        '/wx_client_register',
        {
            "action": "授权登录",
            "method": "post",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    'getQnToken': [
        '/get_qn_token',
        {
            "action": "获取七牛token",
            "method": "post",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    'getUserInfo': [
        '/getInfo',
        {
            "action": "获取用户信息",
            "method": "get",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    // 商品
    'getProductList': [
        '/gu/goods/goods_list',
        {
            "action": "商品列表",
            "method": "get",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    'getGoodDetail': [
        '/gu/goods/get_goods_detail',
        {
            "action": "商品详情",
            "method": "get",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    'addGoods': [
        '/gu/goods/add_goods',
        {
            "action": "添加商品",
            "method": "post",
            "encrypt": false,
        }
    ],
    'updateGoods': [
        '/gu/goods/upd_goods',
        {
            "action": "更新商品",
            "method": "post",
            "encrypt": false,
        }
    ],
    'opeSku': [
        '/gu/goods/opt_sku',
        {
            "action": "sku操作",
            "method": "post",
            "encrypt": false,
        }
    ],
    // 店铺
    'getShopList': [
        '/gu/shop/shop_list',
        {
            "action": "获取店铺列表",
            "method": "get",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    'setShopCache': [
        '/gu/shop/set_shop_cache',
        {
            "action": "设置店铺缓存",
            "method": "get",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    'createShop': [
        '/gu/shop/create_shop',
        {
            "action": "创建店铺",
            "method": "post",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    'addClerk': [
        '/gu/shop/bind_clerk',
        {
            "action": "绑定店员",
            "method": "post",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    'delClerk': [
        '/gu/shop/del_clerk',
        {
            "action": "删除店员",
            "method": "post",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    'getShopUserList': [
        '/gu/shop/shop_user_list',
        {
            "action": "店铺用户列表",
            "method": "get",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    // 手机
    'updateUserInfo': [
        '/upd_user',
        {
            "action": "修改手机号",
            "method": "post",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    // 订单
    'getOrderList': [
        '/gu/order/order_list',
        {
            "action": "订单列表",
            "method": "get",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    'getCartList': [
        '/gu/order/get_order_cache_list',
        {
            "action": "订单暂存列表",
            "method": "get",
            "encrypt": false,
            "headers": {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    ],
    'addCartGoods': [
        '/gu/order/add_order_cache',
        {
            "action": "订单暂存新增",
            "method": "post",
            "encrypt": false
        }
    ],
    'addOrder': [
        '/gu/order/add_order',
        {
            "action": "订单新增",
            "method": "post",
            "encrypt": false
        }
    ]
}

const API = new ApiUtils(api).result;
/*
 * 使用说明 headers请求头
 API.queryAdList({
 'type':
 },{headers:{},xxx:xxxx}).then((res) => {

 }).catch((res) => {

 });
 * */

export default API;
